<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
//        $schedule->command('command:test')->everyFiveMinutes();//每五分钟运行一次任务
//        $schedule->command('command:test')->weekly()->fridays()->at('23:46');// 每个星期六运行任务
//        $schedule->command('command:test')->weekly()->saturdays()->at('02:00');// 每个星期六运行任务
//        $schedule->command('command:test')->weekly()->weekdays()->at('03:00');// 每个星期天运行任务

        // 周结账
        $schedule->command('command:weekcheckout')->weekly()->saturdays()->at('01:00');// 每个星期六运行任务

        // 用户周返佣金计算
        $schedule->command('command:weekprofitreturn')->weekly()->saturdays()->at('01:30');// 每个星期六运行任务

    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
